package com.yl.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yl.config.JsonLongSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

//	@TableId(value = "id", type = IdType.AUTO)
	@ApiModelProperty("Id")
	@JsonSerialize(using = JsonLongSerializer.class )		//Long类型长度过长，导致精度丢失方案
	private Long id;

	@ApiModelProperty("创建时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date createTime;				//创建时间

	@ApiModelProperty("更新时间")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	private Date updateTime;				//更新时间

	@ApiModelProperty("是否删除")
	private Boolean isDel;				//状态

}
